<!-- 权限管理模板 -->
<div class="bg-light lter b-b wrapper-sm">
    <h1 class="m-n font-thin h4">权限管理</h1>
</div>
<div class="wrapper-sm" ng-controller="authorizationManagentController">
    <div class="panel panel-default">
        <div class="panel-heading font-bold">查询</div>
        <div class="panel-body">
            <div class="form-group">
                <label class="control-label pull-left m-t-xs">权限Tag</label>
                <div class="col-md-2">
                    <input ng-model="queryTerms.authorizationTag" id="table_authorizationManagent_authorizationTag" name="authorizationTag" type="text" class="form-control input-sm" placeholder="请输入权限tag" />
                </div>
                <label class="control-label pull-left m-t-xs">权限分类</label>
                <div class="col-md-2 form-group">
                    <select ng-model="queryTerms.authorizationTypeId" ng-options="x.id as x.name for x in authorizationTypeDropDown" id="table_authorizationManagent_authorizationTypeId" class="form-control input-sm" id="authorizationTypeId">
                        <option value="">全部</option>
                    </select>
                </div>
                <div class="col-md-2">
                    <button ng-click="query()" id="table_authorizationManagent_query" class="btn btn-sm btn-default btn-addon" ng-class="{'disabled':querying}" ng-disabled="querying">
                        <i class="fa fa-search" ng-show="!querying"></i>
                        <i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
                        <span ng-show="!querying">查询</span>
                        <span ng-show="querying">查询中...</span>
                    </button>
                </div>
            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            权限列表
        </div>
        <div class="table-responsive">
            <div ui-grid="gridOptions" id="table_authorizationManagent_gridOptions" ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style="height:{{heightA}}px; overflow:hidden;">
                <div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
            </div>
        </div>
    </div>
    <button ng-click="addAuthorization()" id="table_authorizationManagent_addAuthorization" class="pull-right-xs btn btn-sm m-b-xs btn-info btn-addon" data-toggle="modal" data-target="#myModal">
        <i class="fa fa-plus"></i>添加
    </button>

    <!-- 添加/编辑对话框 -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" id="closeModal">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">{{title}}</h4>
                </div>
                <form class="form-horizontal form-validation" id="AuthForm" novalidate>
                    <div class="modal-body">
                        <div class="form-group">
                            <label class="col-lg-4 control-label">权限Tag<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input ng-model="detail.tag" id="table_authorizationManagent_detail_tag" name="tag" type="text" class="form-control" placeholder="请填写权限Tag" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">控制器<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input ng-model="detail.controller" id="table_authorizationManagent_detail_controller" type="text" class="form-control" placeholder="请填写控制器" name="controller" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">动作<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input ng-model="detail.action" id="table_authorzationManagent_detail_action" type="text" class="form-control" placeholder="请填写动作" name="action" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">权限分类<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <select ng-model="detail.authorizationTypeId" id="table_authorizationManagent_detail_authorizationTypeId" class="form-control" ng-options="x.id as x.name for x in authorizationTypeDropDown" name="authorizationTypeId" required>
                                    <option value="">请选择</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">是否启用</label>
                            <div class="col-lg-4">
                                <label class="checkbox i-checks">
                                    <input ng-model="detail.isEnabled" id="table_authorizationManagent_detail_isEnabled" type="checkbox" checked name="isEnabled"><i></i>启用
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">说明<span class="text-danger"></span></label>
                            <div class="col-lg-6">
                                <textarea ng-model="detail.description" id="table_authorizationManagent_detail_description" class="form-control" placeholder="请输入说明"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button id="table_authorizationManagent_detail_cancel" type="button" class="btn btn-default" data-dismiss="modal" id="calceEditauthorization">取消</button>
                        <button ng-click="detail.click()" id="table_authorizationManagent_detail_click" type="button" class="btn btn-primary" id="saveEditauthorization">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>